
    package org.csmz.xg2334;public class 水仙花数 {
        package org.csmz.xg2334
        public class 水仙花数 {
            public static void main(String[] args){
                int num = 153;
                int hundreds = num / 100;
                int tens = (num % 100) / 10;
                int units = num % 10;
                int sum = (int) (Math.pow(hundreds, 3)
                        + Math.pow(tens, 3)
                        + Math.pow(units, 3));

                System.out.println(num + "是水仙花数吗？→ " + (sum == num));
            }
        }
}
